﻿using System;
using yunio;

namespace padmsg._api
{
    internal partial class padapi
    {
        internal string base_uri { get; set; }
        internal string token { get; set; }
        public padapi(string baseuri, string token)
        {
            this.base_uri = baseuri;
            this.token = token;
        }
        /// <summary>
        /// 获取token
        /// </summary>
        public YunioJson new_token(string adminkey, int day)
        {
            return new_token(base_uri, adminkey, day);
        }
        /// <summary>
        /// 登录二维码
        /// </summary>
        public YunioJson download_login_QRcode()
        {
            return download_login_QRcode(base_uri, token);
        }
        /// <summary>
        /// 唤醒登录
        /// </summary>
        public YunioJson wakeup_login()
        {
            return wakeup_login(base_uri, token);
        }
        /// <summary>
        /// 退出登录
        /// </summary>
        public YunioJson logout()
        {
            return logout(base_uri, token);
        }
        /// <summary>
        /// 获取登录状态
        /// </summary>
        public YunioJson get_loginstatus()
        {
            return get_loginstatus(base_uri, token);
        }
        /// <summary>
        /// 发送文本消息
        /// </summary>
        public YunioJson send_text(string to_userid, string message)
        {
            return send_text(base_uri, token, to_userid, message);
        }
        /// <summary>
        /// 发送图片消息
        /// </summary>
        public YunioJson send_image(string to_userid, string img_uri)
        {
            return send_image(base_uri, token, to_userid, img_uri);
        }
        /// <summary>
        /// 发送音频消息
        /// </summary>
        public YunioJson send_voice(string to_userid, string voice_data, int voice_format, int voice_second)
        {
            return send_voice(base_uri, token, to_userid, voice_data, voice_format, voice_second);
        }
        /// <summary>
        /// 发送名片消息
        /// </summary>
        public YunioJson send_card(string to_userid, string card_alis, int flag, string nickname, string cardid)
        {
            return send_card(base_uri, token, to_userid, card_alis, flag, nickname, cardid);
        }
        /// <summary>
        /// 发送app消息
        /// </summary>
        public YunioJson send_appmsg(string to_userid, string xml_data, int content_type)
        {
            return send_appmsg(base_uri, token, to_userid, xml_data, content_type);
        }
        /// <summary>
        /// 发送emoji消息
        /// </summary>
        public YunioJson send_emoji(string to_userid, string emoji_md5, int emoji_size)
        {
            return send_emoji(base_uri, token, to_userid, emoji_md5, emoji_size);
        }
        /// <summary>
        /// 撤回消息
        /// </summary>
        public YunioJson revoke_send(string to_userid, long msgid, long createtime, string newmsgid)
        {
            return revoke_send(base_uri, token, to_userid, msgid, createtime, newmsgid);
        }
        /// <summary>
        /// 获取用户信息
        /// </summary>
        public YunioJson get_me_profile()
        {
            return get_me_profile(base_uri, token);
        }
        /// <summary>
        /// 获取用户二维码
        /// </summary>
        public YunioJson get_me_qrcode(bool recover, int style)
        {
            return get_me_qrcode(base_uri, token, recover, style);
        }
        /// <summary>
        /// 获取设备信息
        /// </summary>
        public YunioJson get_me_safetyinfo()
        {
            return get_me_safetyinfo(base_uri, token);
        }
        /// <summary>
        /// 上传用户头像
        /// </summary>
        public YunioJson upload_headimage(string head_img_base64)
        {
            return upload_headimage(base_uri, token, head_img_base64);
        }
        /// <summary>
        /// cdn下载
        /// </summary>
        public YunioJson download_cdn(string aeskey, int filetype, string fileuri)
        {
            return download_cdn(base_uri, token, aeskey, filetype, fileuri);
        }
        /// <summary>
        /// 下载语音
        /// </summary>
        public YunioJson download_voice(string bufid, int length, string newmsg_id)
        {
            return download_voice(base_uri, token, bufid, length, newmsg_id);
        }
        /// <summary>
        /// 查看群成员详情
        /// </summary>
        public YunioJson get_chatroom_detail(string chatroom_name)
        {
            return get_chatroom_detail(base_uri, token, chatroom_name);
        }
    }
}
